#!/bin/bash

#实时处理 res_oil 表
sh /home/marvin/realtime_job/sql/select/res_oil_select.sh |awk ' NR !=1 {print "INSERT into result.res_oil VALUES('\''"$1,$2"'\'',","'\''"$3"'\'',","'\''"$4"'\'',",$5,","$6,","$7") on duplicate key update oilNumber="$5",oilLitre="$6",oilMoney="$7";"}' >/home/marvin/realtime_job/mysql/res_oil_insert.sql
mysql -uroot  -proot </home/marvin/realtime_job/mysql/res_oil_insert.sql
mysql -uroot  -proot -e "replace into result.res_update(res_table) VALUES('res_oil')"
